<?php /* Smarty version Smarty-3.1.13, created on 2014-11-02 01:12:57
         compiled from "E:\website\bb_cms\templates\admin\mail.tpl" */ ?>
<?php /*%%SmartyHeaderCode:24466545514998fc835-79303554%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'af87406979e9f7699f89eea418944c79362028c3' => 
    array (
      0 => 'E:\\website\\bb_cms\\templates\\admin\\mail.tpl',
      1 => 1412780801,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '24466545514998fc835-79303554',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_54551499952742_46026906',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54551499952742_46026906')) {function content_54551499952742_46026906($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("admin/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
 <?php echo $_smarty_tpl->getSubTemplate ("admin/navibar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
 <?php echo $_smarty_tpl->getSubTemplate ("admin/sidebar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>



<link rel="stylesheet" type="text/css"
	href="<?php echo @constant('WEBSITE_URL');?>
/public/assets/lib/jquery-easyui-1.3.4/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<?php echo @constant('WEBSITE_URL');?>
/public/assets/lib/jquery-easyui-1.3.4/themes/icon.css">
<script type="text/javascript"
	src="<?php echo @constant('WEBSITE_URL');?>
/public/assets/lib/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<?php echo @constant('WEBSITE_URL');?>
public/assets/lib/ajaxupload.js"></script>

<style type="text/css">
#addwin {
	margin: -500px 0 0 -280px;
	/* PLAY THE WITH THE VALUES TO SEE GET THE DESIRED EFFECT */
}
</style>


<div class="content">
	<div class="header">
		<div class="stats">
			<p class="stat">
				<!--span class="number"></span-->
			</p>
		</div>

		<h1 class="page-title">邮件发送管理</h1>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
		<div class="block">
				<div id="page-menu" class="block-body collapse in">
				<h5>测试发送Email</h5>
					<br />
<!-- 					action="admin/mail/sendMail" -->
					<form class="form-search" method="post" id="sendMailform" >
						<div class="input-prepend">
							<span class="add-on">标题:</span> <input class="input-medium"
								type="text" placeholder="title" name="title"
								id="title" style="width: 135px;"> 
						</div>
						<div class="input-prepend">
							<span class="add-on">内容:</span> <input class="input-medium"
								type="text" placeholder="content" name="content"
								id="content" style="width: 135px;">
						</div>
						<div class="input-prepend">
							<span class="add-on">收件人:</span> <input class="input-medium"
								type="text" placeholder="address" name="address"
								id="address" style="width: 135px;">
						</div>
						<button type="button" class="btn btn-primary" onclick="send()" >发送(mail/sendMail)</button>
					</form>
				</div>
			</div>
		
			<!--- START 以上内容不需更改，保证该TPL页内的标签匹配即可 --->
			<h5>已经配置的Email列表</h5>
			<table id="grid"
				data-options="url:'admin/mail/getpage',fitColumns:true,singleSelect:true"
				class="easyui-datagrid" style="width: 1000px; height: 370px"
				toolbar="#toolbar" iconCls="icon-save" pagination="true"
				rownumbers="true">
				<thead>
					<tr>
						<th data-options="field:'id',width:100,checkbox:true"></th>
						<th data-options="field:'name',width:200">邮件名</th>
						<th data-options="field:'password',width:150">邮件使用密码</th>
						<th data-options="field:'smtp',width:150">smtp</th>
						<th data-options="field:'port',width:150">端口</th>
						<th data-options="field:'count_use',width:150">当天已发送数</th>
						<th data-options="field:'count_total',width:150">单天最大发送量</th>
						<th data-options="field:'time',width:150">当前时间</th>
						<th data-options="field:'sitename',width:140">发送者别名</th>
						<th data-options="field:'desc',width:100">描述</th>
					</tr>
				</thead>
			</table>

			<div id="toolbar">
				<a href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-add" plain="true" onclick="addWindow()">添加</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-edit" plain="true" onclick="editWindow()">修改</a> <a
					href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-remove" plain="true" onclick="removeitem()">删除</a>
			</div>

			<div id="addwin" class="modal hide fade">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h5>邮件信息管理</h5>
				</div>
				<div class="modal-body">
					<form class=" form-horizontal" id="dataform">
						<input id="id" name="id" type="text"
							style="display: none;">
						<div class="control-group">
							<label class="control-label">邮件名:</label>
							<div class="controls">
								<input id="name" type="text" placeholder="邮件名称"
									name="name">
							</div>
						</div>


						<div class="control-group">
							<label class="control-label">邮箱密码:</label>
							<div class="controls">
								<input id="password" type="text" placeholder="邮箱密码"
									name="password">
							</div>
						</div>
						
						
						<div class="control-group">
							<label class="control-label">SMTP:</label>
							<div class="controls">
								<input id="smtp" type="text" placeholder="SMTP"
									name="smtp">
							</div>
						</div>
						<div class="control-group">
							<label class="control-label">端口号:</label>
							<div class="controls">
								<input id="port" type="text" placeholder="默认端口为25" value="25" 
									name="port"> 
							</div>
						</div>
						<div class="control-group">
							<label class="control-label">发送者别名:</label>
							<div class="controls">
								<input id="sitename" type="text" placeholder="发送者别名"
									name="sitename">
							</div>
						</div>
						<div class="control-group">
							<label class="control-label">单天最大发送数:</label>
							<div class="controls">
								<input id="count_total" type="text" placeholder="单天最大发送数"
									name="count_total">
							</div>
						</div>
						<div class="control-group">
							<label class="control-label">描述:</label>
							<div class="controls">
								<textarea id="desc" rows="2" type="text"
									placeholder="描述" name="desc">
							</textarea>
							</div>
						</div>
					</form>
				</div>
				<div class="modal-footer" id="div_view">
					<button class="btn btn-success" onclick="addOrModifyItem()"
						type="button" style="width: 100px; align: right;" class="btn">提交</button>

				</div>
			</div>
			<!--- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 --->
			<?php echo $_smarty_tpl->getSubTemplate ("admin/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


			<script type="text/javascript"
				src="<?php echo @constant('WEBSITE_URL');?>
public/js/rmanger.js"></script>
			<script type="text/javascript">
        var weburl = '<?php echo @constant('WEBSITE_URL');?>
';
        var url = weburl+"admin/mail";
        var key = "id";

        
        function send(){
        	$.ajax({
                type: "POST",
                url: url+'/sendMail',
               	data: $("#sendMailform").serialize(),
                success:function(data){
                	$.messager.alert('发送结果',data);
        	    },
                error: function () {
                }
            });
        }
        function addWindow(){
        	model("addwin",0);
        	$("#dataform").form('clear');
        }
    	function editWindow(){
    		var select = getSelectItem();
    		if(select == null || select.length == 0 ){
    			$.messager.alert('错误','请选择要修改的记录!');
    			return;
    		}
    		 model("addwin",0);
    		$("#dataform").form('clear');
    		$("#dataform").form('load',select[0]);

    	
    	}
    	function t_modelhide(){
    		 model("addwin",1);
    	}
     </script><?php }} ?>